print(321/12)
print(321//12)#//整除
print(321%12)
print(12**2)#**求幂
print(12*2)
#求幂优先级高于乘除高于加减
a=2
b=4
a+=b
a*=a+2
print(a)
flag0 = 1 == 1
flag1 = 3 > 2
flag2 = 2 < 1
flag3 = flag1 and flag2
flag4 = flag1 or flag2
flag5 = not flag0
print('flag0=',flag0)
print('flag1=',flag1)
print('flag2=',flag2)
print('flag3=',flag3)
print('flag4=',flag4)
print('flag5=',flag5)
print(flag1 and not flag2)
#将华氏温度转摄氏温度
f = float(input('请输入华氏温度'))
c = (f-32)/1.8
print('%.1f华氏度 = %.1f摄氏度' %(f,c))#格式化：将f和c替换两个float变量
print(f'{f:.1f}华氏度 = {c:.1f}摄氏度')#f表示这个句子需要格式化，就是用f和c替换两个占位符
#计算圆的周长和面积
import math
radius = float(input('请输入圆的半径'))
perimeter = 2*math.pi*radius
area = math.pi*radius**2
print('周长：%.2f' % perimeter)
print('面积：%.2f' % area)
#判断闰年
year = int(input('请输入年份：'))
is_leap = year%4 ==0 and year %100 !=0 or year %400 ==0
print(f'{is_leap = }')